﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Pampa.CRUD.Configuration;
using Pampa.MVC.Fluent.Crud.Groups;

namespace Pampa.MVC.Fluent.Crud.Items
{
    public class SelectorItemBuilder<TGroup, TEditor> : EditItemBuilder<TGroup, TEditor, object, SelectorItemBuilder<TGroup, TEditor>>
    {
        private SelectorItem _item;

        public SelectorItemBuilder(SelectorItem item)
            : base(item)
        {
            _item = item;
        }

        public SelectorItemBuilder(GroupBuilder<TGroup, TEditor> group, SelectorItem item)
            : base(group, item)
        {
            _item = item;
        }

        public SelectorItemBuilder<TGroup, TEditor> EmptyText(string emptyText)
        {
            _item.EmptyText = emptyText;
            return this;
        }

        public SelectorItemBuilder<TGroup, TEditor> FreeText(bool freeText)
        {
            _item.FreeText = freeText;
            return this;
        }

        public SelectorItemBuilder<TGroup, TEditor> DataHandler(string dataHandler)
        {
            _item.DataHandler = dataHandler;
            return this;
        }
    }
}
